Skip to content

Conversation

@yoshuawuyts
Copy link
Contributor

@yoshuawuyts yoshuawuyts commented Sep 12, 2019

Adds the future::{join,try_join} macros. Depends on publishing a first release of https://github.com/async-rs/async-macros first (@stjepang could I get publish access to crates.io for async-macros?). Thanks!

Closes #14, #175.

Screenshot

This is what the docs look like:

Screenshot_2019-09-12 async_std future - Rust

@yoshuawuyts
Copy link
Contributor Author

Updated with select and try_select!

Screenshot_2019-09-14 async_std future - Rust

@yoshuawuyts yoshuawuyts changed the title add future::{join,try_join} macros add future::{join,try_join,select,try_select} macros Sep 14, 2019
@yoshuawuyts yoshuawuyts mentioned this pull request Sep 17, 2019
6 tasks
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
@yoshuawuyts yoshuawuyts mentioned this pull request Sep 17, 2019
@yoshuawuyts yoshuawuyts added the enhancement New feature or request label Sep 17, 2019
@yoshuawuyts yoshuawuyts marked this pull request as ready for review September 17, 2019 21:25
@yoshuawuyts yoshuawuyts requested a review from a user September 17, 2019 21:26
@yoshuawuyts
Copy link
Contributor Author

This PR is ready for review now that async-macros has been published! 🎉

bors bot added a commit that referenced this pull request Sep 19, 2019
208: add stream::join r=stjepang a=yoshuawuyts

Ref #129 #187. This adds the `stream::join` which can join multiple streams into a single stream. Thanks!

## Example
```rust
let a = stream::once(1u8);
let b = stream::once(2u8);
let c = stream::once(3u8);

let mut s = stream::join!(a, b, c);

assert_eq!(s.collect().await, vec![1u8, 2u8, 3u8]);
```

## Screenshot

![Screenshot_2019-09-17 async_std stream - Rust](https://user-images.githubusercontent.com/2467194/65080099-cedb8b00-d9a0-11e9-984f-edd7d6bad5cc.png)


Co-authored-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
@yoshuawuyts
Copy link
Contributor Author

We now have stream::join as module-level macro and marked as unstable. I think it should be okay to merge this to let people try this out in the next release. Thanks!

@yoshuawuyts yoshuawuyts merged commit 785371c into master Sep 24, 2019
@yoshuawuyts yoshuawuyts deleted the join-macros branch September 24, 2019 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Future::join

2 participants